package com.jcxy.util;

import com.jcxy.pojo.Role;

import java.util.List;

/**
 * 分页工具类
 */
public class PageBean {

    private Integer page;//当前页
    private Integer limit;//页容量
    private Integer pageIndex;//页索引
    private ResponseData responseData;

    public PageBean(Integer page, Integer limit) {
        this.page = page;
        this.limit = limit;
    }

    public Integer getPage() {
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public Integer getLimit() {
        return limit;
    }

    public void setLimit(Integer limit) {
        this.limit = limit;
    }

    public Integer getPageIndex() {
        return (page - 1) * limit;
    }

    public ResponseData getResponseData() {
        return responseData;
    }

    public void setResponseData(Integer count, List roleList) {

        ResponseData ok = ResponseData.ok();
        ok.setCount(count);
        ok.setData(roleList);
        ok.setCode(0);
        this.responseData = ok;
    }
}
